/**
 * 将post请求参数转换为query string
 * 
 **/
export const jsonToQueryString = (json: any) => {
    if (json) {
        return Object.entries(json)
            .map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`)
            .join('&');
    }
    return ""
}

// js将秒转化为时分秒
export const convertSecondsToHHMMSS = (seconds: number) => {
    const hours = Math.floor(seconds / 3600);
    const remainingSeconds = seconds % 3600;
    const minutes = Math.floor(remainingSeconds / 60);
    const sec = Math.floor(remainingSeconds % 60);

    return `${hours < 10 ? '0' + hours : hours}:${minutes < 10 ? '0' + minutes : minutes}:${sec < 10 ? '0' + sec : sec}`;
}